3.4.6 Factor
Factor finds integer roots in most cases where they exist. A quadratic factor is left as such even though it may have integer roots.
- The factors of
x^3-7⋅x-6 are(x+2)⋅(x-3)⋅(x+1) . The factoring consists of monic linear polynomials that represent roots at-2 ,3 and-1 . -
The factors of
x^4-1 include a quadratic(x^2+1)⋅(x-1)⋅(x+1) which has no real roots. They can be found using Quadratic and shown to be imaginary:(x-√(-4)÷2)⋅(x+√(-4)÷2)⋅(x-1)⋅(x+1) . - Even if the quadratic has real roots, it is left in quadratic form. That is,
x^4+2⋅x^3-2⋅x^2-2⋅x+1 factors to(x^2+2⋅x-1)⋅(x-1)⋅(x-1) even thoughx^2+2⋅x-1 has real roots. These can be found by Quadratic ; the final factoring is(x-(-2+√8)÷2)⋅(x-(-2-√8)÷2)⋅(x-1)⋅(x+1) . - Finally, linear roots are not necessarily monic.
2⋅x^2-2 factors to(x-1)⋅(2⋅x+2) . The monic form can be found by applying the fast-action Factor to produce the product of linear monics(x-1)⋅2⋅(x+1) .
Factors are found by generating a set of trial factors from the subject and applying polynomial division to produce a quotient and a remainder. If the remainder is zero, the trial factor is an actual factor. Transformation continues by factoring the quotient as the new subject. If the trial factor is cubic or higher it is factored as well.
Trial factors are generated from integer factors (including 1) of the leading exponent and the constant coefficient.
For example, the expression